package com.my.vertx.udp;

import io.vertx.core.Vertx;
import io.vertx.core.datagram.DatagramSocket;
import io.vertx.core.datagram.DatagramSocketOptions;

/**
 * @author: marshal
 * @date: 2023-04-17 16:13
 */
public class VertxUdpServerTest {
    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();
        DatagramSocket socket = vertx.createDatagramSocket();
        // 发送字符串
        socket
                .send("This is udp Server", 9601, "127.0.0.1")
                .onComplete(asyncResult -> System.out.println("Send succeeded? " + asyncResult.succeeded()));
    }
}
